package com.ktjy.market.controller;

import com.ktjy.market.pojo.AppCategory;
import com.ktjy.market.service.AppCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/appCategory")
public class AppCategoryController {

    @Autowired
    private AppCategoryService appCategoryService;


    @GetMapping("/category1")
    @ResponseBody
    public List<AppCategory> category1(@RequestParam(value = "pid",required = false,defaultValue = "1") Long pid){
       return appCategoryService.category1(pid);
    }

    @GetMapping("/category2")
    @ResponseBody
    public List<AppCategory> category2(@RequestParam(value = "pid",required = false,defaultValue = "1") Long pid){
        return appCategoryService.category1(pid);
    }
}
